<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>...</title>
		<link rel="stylesheet" href="css/base.css" />
		<script type="text/javascript" src="js/base.js" ></script>
		<script type="text/javascript" src="js/jquery-3.3.1.js" ></script>
		<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
	</head>
	<body>
		<div class="defHint">正在加载,请稍后..</div>
	</body>
	<script>
		
		// 缓存信息
		localStorage.mchKey=getUrlParam().mchKey;
		isWeixin();
		
		// 判断浏览器
		if(localStorage.browerType=="MicroMessenger"){ // 微信
			
			// 获取微信缤纷生活code
			var appid="wx249ef074b1b6381a";
			var params = location.search.replace(/&/g,"___");
			var httpUrl=encodeURI("https://cdadmin.landdt.cn/h5/pay/pages/microMessenger_pay/code.html" + params);
			if(localStorage.mchKey){
				let url="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+"&redirect_uri="+httpUrl+"&response_type=code&scope=snsapi_base&state&connect_redirect=1#wechat_redirect";
				location.replace(url);
			} else {
				hint("未获取到mchKey");
			}
			
		} else if(localStorage.browerType=="AlipayClient"){ // 支付宝
			
			var app_id="2019031163514575";
			var params = location.search.replace(/&/g,"___");
			var redirect_uri=encodeURI("https://cdadmin.landdt.cn/h5/pay/pages/alipayClient_pay/auth_code.html" + params);
			
			if(localStorage.mchKey){ 
				let url="https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id="+app_id+"&scope=auth_user&redirect_uri="+redirect_uri;
				location.replace(url);
			} else {
				hint("未获取到mchKey");
			}
			
		} else {
			loading("请用微信或支付宝扫码付款");
		}
	</script>
</html>